home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / namedCommandSetup.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  31.0 KB  |  1,056 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Original Authors:    rg, gf, mm
  19. //
  20. //  Description:
  21. //    This contains procedures necessary for
  22. //    the Hotkey/NameCommand editor.
  23. //
  24.  
  25. proc buildNameCommandsForMenu(
  26.     string $thisMenu, string $prefix,
  27.     string $menuItemsWhoseNameCommandsMustBeCreatedImmediately[],
  28.     string $commandStringsOfTheMenuItems[],
  29.     string $namesToUseForTheNameCommands[]
  30. ) {
  31.     int $numItems = `menu -q -ni $thisMenu`;
  32.     if ($numItems == 0) {
  33.         // Try to build the menu
  34.         string $pmCmd = `menu -q -pmc $thisMenu`;
  35.         catch(eval($pmCmd));
  36.         $numItems = `menu -q -ni $thisMenu`;
  37.     }
  38.  
  39.     if ($numItems > 0) {
  40.         string $items[] = `menu -q -ia $thisMenu`;
  41.         string $previousItem = "";
  42.         string $itemLabel;
  43.         string $annotation;
  44.         int $j;
  45.  
  46.         setParent -m $thisMenu;
  47.         for ($i=0; $i < $numItems; ++$i) {
  48.  
  49.     
  50.             // Handle the following strange bug: sometimes
  51.             // the array of menu items passed back contains
  52.             // "nonexistent" items.  Try, for example, creating
  53.             // a sphere and selecting it.  This will cause a
  54.             // "transform" submenu to appear in the "Keys"
  55.             // menu.  When the hotkey editor is opened,
  56.             // and the menubar is traversed, the array of
  57.             // items returned for the "Keys" menu contains a
  58.             // "nonexistent" item right where the "transform"
  59.             // submenu should be.
  60.             //
  61.             if (!`menuItem -exists $items[$i]`) {
  62.                 continue;
  63.             }
  64.  
  65.             // Handle dividers
  66.             //
  67.             if (`menuItem -q -d $items[$i]`) {
  68.                 $previousItem = "";
  69.                 continue;
  70.             }
  71.  
  72.             // Handle option boxes
  73.             //
  74.             if (`menuItem -q -iob $items[$i]`) {
  75.                 if ($previousItem != "")
  76.                     $itemLabel = (`menuItem -q -l $previousItem` + " (Option Box)");
  77.                 else
  78.                     $itemLabel = (`menuItem -q -l $items[$i]` + " (Option Box)");
  79.             }
  80.             else {
  81.                 $itemLabel = `menuItem -q -l $items[$i]`;
  82.  
  83.     
  84.                 // The Edit->Repeat menuItem has a label that dynamically updates.
  85.                 // Fortunately, this label always starts with the string "Repeat".
  86.                 // So we cath this menuItem and substitute its label for one that
  87.                 // is more appropriate within the hotkey editor.
  88.                 //
  89.                 // A note about regular expressions: "^abc..." will match with "abc..."
  90.                 // when "abc..." occurs at the beginning of the string.
  91.                 // See "man ed" for more info on regular expression syntax.
  92.                 //
  93.                 if (match("^Repeat",$itemLabel) != "" && $prefix == "Edit->") {
  94.                     $itemLabel = "Repeat";
  95.                 }
  96.             }
  97.             $previousItem = "";
  98.  
  99.             if (`menuItem -q -sm $items[$i]`) {
  100.  
  101.                 // Recursive step: do the items in this submenu
  102.                 //
  103.                 buildNameCommandsForMenu($items[$i], ($prefix+`menuItem -q -l $items[$i]`+"->"),
  104.                     $menuItemsWhoseNameCommandsMustBeCreatedImmediately,
  105.                     $commandStringsOfTheMenuItems,
  106.                     $namesToUseForTheNameCommands
  107.                  );
  108.             }
  109.             else {
  110.                 //if (`menuItem -q -isCheckBox $items[$i]`) {
  111.                 //    ...
  112.                 //} else if (`menuItem -q -isRadioButton $items[$i]`) {
  113.                 //    ...
  114.                 //}
  115.  
  116.                 // Check if the named command has a predefined name, and if so use it.
  117.                 //
  118.                 $annotation = ($prefix + $itemLabel);
  119.                 for ($j = size($menuItemsWhoseNameCommandsMustBeCreatedImmediately) - 1; $j >= 0; --$j)
  120.                     if ($menuItemsWhoseNameCommandsMustBeCreatedImmediately[$j] == $annotation)
  121.                         break;
  122.                 if ($j >= 0) {
  123.                     // The loop broke - hence, a match was found.
  124.                     // Use the predefined name so that the default hotkey mappings will still work.
  125.                     //
  126.                     nameCommand -annotation $annotation -command $commandStringsOfTheMenuItems[$j] $namesToUseForTheNameCommands[$j];
  127.  
  128.                     // The following check is very important.  The command strings attached to menu items
  129.                     // (as created in the various menu-creation scripts) should be identical to the command
  130.                     // strings attached to corresponding nameCommands (as defined in *this* script).
  131.                     //
  132.                     if (`menuItem -q -c $items[$i]` != $commandStringsOfTheMenuItems[$j]) {
  133.                         warning "command string mismatch in namedCommandSetup.mel";
  134.                         print (   "    The command string for the menu item \"" + $annotation + "\"\n"
  135.                             + "    does not match the command string for its corresponding hotkey.\n"
  136.                             + "    Command string for menu item: " + `menuItem -q -c $items[$i]` + "\n"
  137.                             + "    Command string for hotkey: " + $commandStringsOfTheMenuItems[$j] + "\n"
  138.                             );
  139.                     }
  140.                 }
  141.                 else {
  142.                     // Let the system generate any old name for us.
  143.                     //
  144.                     nameCommand -annotation $annotation -command `menuItem -q -c $items[$i]`;
  145.                 }
  146.                 $previousItem = $items[$i];
  147.             }
  148.         }
  149.         setParent -m ..;
  150.     }
  151. }
  152.  
  153. // BEGIN: traverse the main menubar, generating namedCommands corresponding to each menu item.
  154. //
  155. {
  156.     // If a menuItem has a default hotkey attached to it, we cannot delay
  157.     // the construction of the menuItem's corresponding nameCommand.
  158.     // The following arrays tell us how to construct them.
  159.     //
  160.     string $menuItemsWhoseNameCommandsMustBeCreatedImmediately[] = {
  161.  
  162.         // File menu
  163.         //
  164.         "File->New Scene",
  165.         "File->Open Scene...",
  166.         "File->Save Scene",
  167.         "File->Save Scene As...",
  168.         "File->Import...",
  169.         "File->Quit",
  170.  
  171.         // Edit menu
  172.         //
  173.         "Edit->Undo",
  174.         "Edit->Redo",
  175.         "Edit->Repeat",                     // must be handled as special case
  176.         "Edit->Select All",
  177.         "Edit->Duplicate",
  178.         "Edit->Group",
  179.         "Edit->Parent",
  180.  
  181.         // Display menu
  182.         //
  183.         "Display->Hide->Hide Selection",
  184.         "Display->Hide->Hide Unselected Objects",
  185.         "Display->Show->Show Last Hidden",
  186.  
  187.         // Window menu
  188.         //
  189.         "Window->Frame All in All Views",
  190.         "Window->Frame Selection in All Views",
  191.         "Window->Attribute Editor...",
  192.  
  193.         // Keys menu
  194.         //
  195.         "Animate->Set Key"
  196.     };
  197.     string $commandStringsOfTheMenuItems[] = {  // If these do not match the actual command strings in the menus, warnings will be spit out.
  198.  
  199.         // File menu
  200.         //
  201.         "NewScene",
  202.         "OpenScene",
  203.         "SaveScene",
  204.         "SaveSceneAs",
  205.         "Import",
  206.         "Quit",
  207.  
  208.         // Edit menu
  209.         //
  210.         "Undo",
  211.         "Redo",
  212.         "RepeatLast",
  213.         "SelectAll",
  214.         "Duplicate",
  215.         "Group",
  216.         "Parent",
  217.         
  218.         // Display menu
  219.         //
  220.         "HideSelectedObjects",
  221.         "HideUnselectedObjects",
  222.         "ShowLastHidden",
  223.  
  224.         // Window menu
  225.         //
  226.         "FrameSelectedInAllViews",
  227.         "FrameAllInAllViews",
  228.         "AttributeEditor",
  229.  
  230.         // Keys menu
  231.         //
  232.         "SetKey"
  233.     };
  234.     string $namesToUseForTheNameCommands[] = {  // These are used in the hotkeySetup.mel file
  235.  
  236.         // File menu
  237.         //
  238.         "NameComNew_File",
  239.         "NameComOpen_File",
  240.         "NameComSave_File",
  241.         "NameComSave_File_As",
  242.         "NameComImport_File",
  243.         "NameComQuit",
  244.  
  245.         // Edit menu
  246.         //
  247.         "NameComUndo",
  248.         "NameComRedo",
  249.         "NameComRepeat_Last_Menu_Action",
  250.         "NameComSelect_All",
  251.         "NameComDuplicate_Selected",
  252.         "NameComGroup_Selected",
  253.         "NameComParent_Selected",
  254.  
  255.         // Display menu
  256.         //
  257.         "NameComHide_Selected_Objects",
  258.         "NameComHide_Unselected_Objects",
  259.         "NameComShow_Last_Hidden",
  260.         
  261.         // Window menu
  262.         //
  263.         "NameComFit_Select_in_All_Panels",
  264.         "NameComFit_All_in_All_Panels",
  265.         "NameComAttribute_Editor",
  266.  
  267.         // Keys menu
  268.         //
  269.         "NameComSet_Keyframe"
  270.     };
  271.  
  272.  
  273.     // Traversing the menus in the main menu bar requires that all
  274.     // menus be forced to build themselves.  Since this would
  275.     // greatly impact Maya's start-up time, we don't do it
  276.     // at start-up time.  Instead, we do it when the hotkey editor
  277.     // is opened (see hotkeyEditor.mel).
  278.     //
  279.     if (`optionVar -exists theExistenceOfThisOptionVarWillCauseTheMenuBarToBeTraversedWhenTheNamedCommandsAreBeingCreated`) {
  280.         global string $gMainWindow;
  281.         setParent $gMainWindow;
  282.         string $menuArray[] = `window -q -ma $gMainWindow`;
  283.         string $label;
  284.         waitCursor -state on;
  285.         for ($menu in $menuArray) {
  286.             $label = `menu -q -label $menu`;
  287.  
  288.             // We do *not* want to traverse hotBox menus (or the "Tests" menu).
  289.             // If the menu label does not contain the word "hotbox",
  290.             // then it's probably safe to traverse the menu.
  291.             //
  292.             if (match("[Hh]ot[Bb]ox",$label) == "" && $label != "Tests" && $label != "Recent Commands") {
  293.                 assignCommand -e -addDivider ($label + " Menu");
  294.                 buildNameCommandsForMenu($menu, ($label + "->"),
  295.                     $menuItemsWhoseNameCommandsMustBeCreatedImmediately,
  296.                     $commandStringsOfTheMenuItems,
  297.                     $namesToUseForTheNameCommands
  298.                 );
  299.             }
  300.         }
  301.         waitCursor -state off;
  302.  
  303.         // IMPORTANT
  304.         // IMPORTANT
  305.         // IMPORTANT: Note that once the hotkey settings have been changed by the user and saved,
  306.         // this file will no longer be sourced (unless the user selects "restore defaults"),
  307.         // *and* the below optionVar will be saved with a value of false (zero).  It is
  308.         // important that this value in fact be saved, so that it will persist from session
  309.         // to session.  DO NOT REPLACE THE BELOW OPTIONVAR WITH A GLOBAL VARIABLE.
  310.         //
  311.         optionVar -iv mainMenuBarNeedsToBeTraversedWhenHotkeyEditorIsOpened 0;
  312.     }
  313.     else {
  314.         optionVar -iv mainMenuBarNeedsToBeTraversedWhenHotkeyEditorIsOpened 1;
  315.  
  316.         // Create the menu-item nameCommands that are necessary
  317.         // for the default hotkey mappings to work.
  318.  
  319.         int $j, $max;
  320.  
  321.         $max = size($menuItemsWhoseNameCommandsMustBeCreatedImmediately) - 1;
  322.  
  323.         for ($j = 0; $j <= $max; ++$j)
  324.             nameCommand
  325.                 -annotation $menuItemsWhoseNameCommandsMustBeCreatedImmediately[$j]
  326.                 -command $commandStringsOfTheMenuItems[$j]
  327.                 $namesToUseForTheNameCommands[$j];
  328.     }
  329. }
  330. //
  331. // END: traverse the main menubar, generating namedCommands corresponding to each menu item.
  332.  
  333.  
  334.  
  335.  
  336. // For Info on how to edit this part of the file, see hotkeySetup.mel
  337. //
  338. //  NOTE:
  339. //      The string at the end of the nameCommand line is the internal name. 
  340. //        This is used by the hotkey command.  However, it doesn't have to 
  341. //        be specified.  It is automatically generated by the software if not 
  342. //        specified.
  343. //
  344. assignCommand -e -addDivider "Modeling Panel Menu Items";
  345.  
  346. nameCommand -annotation "Wireframe Display" 
  347.     -command "DisplayWireframe"
  348.     "NameComWireframe_Display" ;
  349.  
  350. nameCommand -annotation "Shaded Display" 
  351.     -command "DisplayShaded"
  352.     "NameComShaded_Display" ;
  353.  
  354. nameCommand -annotation "Shaded and Textured Display" 
  355.     -command "DisplayShadedAndTextured"
  356.     "NameComShaded_and_Textured_Display" ;
  357.  
  358.     // Modeling pane: View/Smooth shade all
  359. nameCommand -annotation "Turn on Light Display" 
  360.     -command "DisplayLight"
  361.     "NameComTurn_on_Light_Display" ;
  362.  
  363.     // Modeling: Lighting
  364.  
  365. nameCommand -annotation "Shading Marking Menu (Press)"
  366.     -command "DisplayShadingMarkingMenu"
  367.     "Name_ShadingMMenu";
  368.     // Modeling:Shading
  369. nameCommand -annotation "Shading Marking Menu (Release)"
  370.     -command "DisplayShadingMarkingMenuPopDown"  
  371.     "Name_ShadingMMenu_release";
  372.     // Modeling:Shading
  373.  
  374. nameCommand -annotation "Fit Selected in Active Panel" 
  375.     -command "FrameSelected" ;
  376.     // Modeling Panes:View/Fit Selected
  377.  
  378. nameCommand -annotation "Fit All in Active Panel, with Marking Menu (Press)"
  379.     -command ("SelectAllMarkingMenu")
  380.     NameComFit_All_in_Active_Panel_MMenu;
  381.     // Modeling:View/Frame All
  382. nameCommand -annotation "Fit All in Active Panel, with Marking Menu (Release)"
  383.     -command ("SelectAllMarkingMenuPopDown")
  384.     NameComFit_All_in_Active_Panel_MMenu_release;
  385.     // Modeling:View/Frame All
  386.  
  387. // There is suspicion that this command already exists in the model panel menu bar->view menu,
  388. // probably one of the items "Look at Selection", "Frame Selection", or "Frame All".
  389. // If this is the case, it should be given an annotation that reflects this (like "View->something",
  390. // where "something" is the label of the menu item it actually corresponds to).
  391. //
  392. nameCommand -annotation "Fit Selected in All Panels" 
  393.     -command "FrameAll"  "NameComFit_Selected_in_All_Panels" ;
  394.  
  395. nameCommand -annotation "Isolate select" 
  396.     -command "SelectIsolate"
  397.     "NameComIsolateSelect" ;
  398.  
  399. //
  400. //    Snapping.
  401. //
  402. // ----------------------------------------------------------------------
  403. assignCommand -e -addDivider "Status Line";
  404.  
  405. nameCommand
  406.     -annotation "Activate   Snap to Curve (Press)" 
  407.     -command ("SnapToCurve")
  408.     NameComSnap_to_Curve_modifierON;
  409.  
  410. nameCommand
  411.     -annotation "Deactivate Snap to Curve (Release)"
  412.     -command ("SnapToCurve")
  413.     NameComSnap_to_Curve_modifierOFF;
  414.  
  415. nameCommand
  416.     -annotation "Activate   Snap to Grid (Press)"
  417.     -command ("SnapToGrid")
  418.     NameComSnap_to_Grid_modifierON;
  419.  
  420. nameCommand
  421.     -annotation "Deactivate Snap to Grid (Release)"
  422.     -command ("SnapToGrid")
  423.     NameComSnap_to_Grid_modifierOFF;
  424.  
  425. nameCommand
  426.     -annotation "Activate   Snap to Point (Press)"
  427.     -command ("SnapToPoint")
  428.     NameComSnap_to_Point_modifierON;
  429.  
  430. nameCommand
  431.     -annotation "Deactivate Snap to Point (Release)"
  432.     -command ("SnapToPoint")
  433.     NameComSnap_to_Point_modifierOFF;
  434.  
  435. //
  436. //    Selection.
  437. //
  438. // ----------------------------------------------------------------------
  439. nameCommand
  440.     -annotation "Toggle Object/Component Editing"
  441.     -command ("SelectToggleMode")
  442.     NameComToggle_ObjectComponent_Editing;
  443.  
  444. nameCommand
  445.     -annotation "Select Polygon & Subd Surface Vertices"
  446.     -command ("SelectVertexMask")
  447.     NameComSet_Vertex_Component_Mask;
  448.  
  449. nameCommand
  450.     -annotation "Select Polygon & Subd Surface Edges"
  451.     -command ("SelectEdgeMask")
  452.     NameComSet_Edge_Component_Mask;
  453.  
  454. nameCommand
  455.     -annotation "Select Polygon & Subd Surface Faces"
  456.     -command ("SelectFacetMask")
  457.     NameComSet_Facet_Component_Mask;
  458.  
  459. nameCommand
  460.     -annotation "Select Polygon & Subd Surface UVs"
  461.     -command ("SelectUVMask")
  462.     NameComSet_UVs_Component_Mask;
  463.  
  464. nameCommand
  465.     -annotation "Select Polygon VertexFaces"
  466.     -command ("SelectVertexFaceMask")
  467.     NameComSet_VertexFace_Component_Mask;
  468.  
  469. nameCommand
  470.     -annotation "Select All Input"
  471.     -command ("SelectAllInput")
  472.     NameComSelect_All_Input;
  473.  
  474. nameCommand
  475.     -annotation "Select All Output"
  476.     -command ("SelectAllOutput")
  477.     NameComSelect_All_Output;
  478.  
  479. //
  480. //    Tools.
  481. //
  482. // ----------------------------------------------------------------------
  483. assignCommand -e -addDivider "Tools";
  484.  
  485. nameCommand
  486.     -annotation "Enter Tool Edit Mode" 
  487.     -command "EnterEditMode"  
  488.     NameComEnter_Tool_Edit_Mode;
  489.  
  490. nameCommand 
  491.     -annotation "Move/Rotate/Scale Tool: Toggle Snap Mode" 
  492.     -command ("MoveRotateScaleToolToggleSnapMode")
  493.     NameComMoveRotateScale_Tool_ToggleSnap;
  494.  
  495. nameCommand 
  496.     -annotation "Move/Rotate/Scale Tool: Toggle Snap Relative Mode" 
  497.     -command ("MoveRotateScaleToolToggleSnapRelativeMode")  
  498.     NameComMoveRotateScale_Tool_ToggleSnapRelative;
  499.  
  500. nameCommand
  501.     -annotation "Move Tool, with Marking Menu (Press)" 
  502.     -command ("TranslateToolMarkingMenu")  
  503.     NameComMove_Tool;
  504.  
  505. nameCommand
  506.     -annotation "Move Tool, with Marking Menu (Release)" 
  507.     -command ("TranslateToolMarkingMenuPopDown")  
  508.     NameComMove_Tool_revert;
  509.  
  510. nameCommand
  511.     -annotation "Rotate Tool, with Marking Menu (Press)" 
  512.     -command ("RotateToolMarkingMenu")
  513.     NameComRotate_Tool;
  514.  
  515. nameCommand 
  516.     -annotation "Rotate Tool, with Marking Menu (Release)" 
  517.     -command ("RotateToolMarkingMenuPopDown")  
  518.     NameComRotate_Tool_revert;
  519.  
  520. nameCommand
  521.     -annotation "Scale Tool, with Marking Menu (Press)"
  522.     -command ("ScaleToolMarkingMenu")
  523.     NameComScale_Tool;
  524.  
  525. nameCommand
  526.     -annotation "Scale Tool, with Marking Menu (Release)" 
  527.     -command ("ScaleToolMarkingMenuPopDown")
  528.     NameComScale_Tool_revert;
  529.  
  530. nameCommand
  531.     -annotation "ShowManip Tool" 
  532.     -command ("ShowManipulators")
  533.     NameComShowManip_Tool;
  534.  
  535. nameCommand
  536.     -annotation "Select Tool" 
  537.     -command ("SelectTool")
  538.     NameComSelect_Tool;
  539.  
  540. nameCommand
  541.     -annotation "Lasso Tool" 
  542.     -command ("LassoTool")
  543.     NameComLasso_Tool;
  544.  
  545. nameCommand
  546.     -annotation "NonSacred Tool" 
  547.     -command ("NonSacredTool")
  548.     NameComNonSacred_Tool;
  549.  
  550. nameCommand
  551.     -annotation "Select Tool, with Object Marking Menu (Press)"
  552.     -command ("SelectToolMarkingMenu")
  553.     NameComSelectTool_ObjectMMenu;
  554.  
  555. nameCommand
  556.     -annotation "Select Tool, with Object Marking Menu (Release)"
  557.     -command ("SelectToolMarkingMenuPopDown")
  558.     NameComSelectTool_ObjectMMenu_release;
  559.  
  560. nameCommand
  561.     -annotation "Select Tool, with Component Marking Menu (Press)"
  562.     -command ("SelectComponentToolMarkingMenu")
  563.     NameComSelectTool_ComponentMMenu;
  564.  
  565. nameCommand
  566.     -annotation "Select Tool, with Component Marking Menu (Release)"
  567.     -command ("SelectComponentToolMarkingMenuPopDown")
  568.     NameComSelectTool_ComponentMMenu_release;
  569.  
  570. nameCommand
  571.     -annotation "Select Tool, with Polygon Marking Menu (Press)"
  572.     -command ("SelectPolygonToolMarkingMenu")
  573.     NameComSelectTool_PolyMMenu;
  574.  
  575. nameCommand
  576.     -annotation "Select Tool, with Polygon Marking Menu (Release)"
  577.     -command ("SelectPolygonToolMarkingMenuPopDown")
  578.     NameComSelectTool_PolyMMenu_release;
  579.  
  580. nameCommand
  581.     -annotation "Select Tool, with Mask Marking Menu (Press)"
  582.     -command ("SelectMaskToolMarkingMenu")
  583.     NameComSelectTool_MaskMMenu;
  584.  
  585. nameCommand
  586.     -annotation "Select Tool, with Mask Marking Menu (Release)"
  587.     -command ("SelectMaskToolMarkingMenuPopDown")
  588.     NameComSelectTool_MaskMMenu_release;
  589.  
  590. // trans/rot/scale with snap
  591. nameCommand
  592.     -annotation "TranslateToolWithSnapMarkingMenuNameCommand"
  593.     -command ("TranslateToolWithSnapMarkingMenu")
  594.     TranslateToolWithSnapMarkingMenuNameCommand;
  595.  
  596. nameCommand
  597.     -annotation "TranslateToolWithSnapMarkingMenuPopDownNameCommand"
  598.     -command ("TranslateToolWithSnapMarkingMenuPopDown")
  599.     TranslateToolWithSnapMarkingMenuPopDownNameCommand;
  600.  
  601. nameCommand
  602.     -annotation "RotateToolWithSnapMarkingMenuNameCommand"
  603.     -command ("RotateToolWithSnapMarkingMenu")
  604.     RotateToolWithSnapMarkingMenuNameCommand;
  605.  
  606. nameCommand
  607.     -annotation "RotateToolWithSnapMarkingMenuPopDownNameCommand"
  608.     -command ("RotateToolWithSnapMarkingMenuPopDown")
  609.     RotateToolWithSnapMarkingMenuPopDownNameCommand;
  610.  
  611. nameCommand
  612.     -annotation "ScaleToolWithSnapMarkingMenuNameCommand"
  613.     -command ("ScaleToolWithSnapMarkingMenu")
  614.     ScaleToolWithSnapMarkingMenuNameCommand;
  615.  
  616. nameCommand
  617.     -annotation "ScaleToolWithSnapMarkingMenuPopDownNameCommand"
  618.     -command ("ScaleToolWithSnapMarkingMenuPopDown")
  619.     ScaleToolWithSnapMarkingMenuPopDownNameCommand;
  620.  
  621. //
  622. //    Playback Range controls.
  623. //
  624. // ----------------------------------------------------------------------
  625. assignCommand -e -addDivider "Playback Range Controls";
  626.  
  627. nameCommand
  628.     -annotation "Move forward one frame in time"
  629.     -command ("NextFrame")
  630.     Name_Frame_Forward;
  631.  
  632. nameCommand
  633.     -annotation "Move backward one frame in time"
  634.     -command ("PreviousFrame")
  635.     Name_Frame_Backward;
  636.  
  637. nameCommand
  638.     -annotation "Go to Next Key"
  639.     -command ("NextKey")
  640.     NameComGo_to_next_keyframe;
  641.  
  642. nameCommand
  643.     -annotation "Go to Previous Key"
  644.     -command ("PreviousKey")
  645.     NameComGo_to_previous_keyframe;
  646.  
  647. nameCommand
  648.     -annotation "Start Play Backwards (Press)"
  649.     -command ("PlaybackBackward")
  650.     NameComPlay_backwards_modifier;
  651.  
  652. nameCommand
  653.     -annotation "Stop  Play Backwards (Release)"
  654.     -command ("AnimatePlaybackStop")
  655.     NameComPlay_backwards_modifier_release;
  656.  
  657. nameCommand
  658.     -annotation "Start Play Forwards (Press)"
  659.     -command ("PlaybackForward")
  660.     NameComPlay_forwards_modifier;
  661.  
  662. nameCommand
  663.     -annotation "Stop  Play Forwards (Release)"
  664.     -command ("PlaybackStop")
  665.     NameComPlay_forwards_modifier_release;
  666.  
  667. nameCommand
  668.     -annotation "Toggle Playback On/Off"
  669.     -command ("PlaybackToggle")
  670.     NameComToggle_Playback_OnOff;
  671.  
  672. // keyframe and tangent marking menus
  673. nameCommand
  674.     -annotation "Keyframe and Tangent Marking Menu (Press)"
  675.     -command ("KeyframeTangentMarkingMenu")
  676.     KeyframeTangentMarkingMenuNameCommand;
  677.  
  678. nameCommand
  679.     -annotation "Keyframe and Tangent Marking Menu (Release)"
  680.     -command ("KeyframeTangentMarkingMenuPopDown")
  681.     KeyframeTangentMarkingMenuPopDownNameCommand;
  682.  
  683. //
  684. //    These are actually a few more Tool commands.  Handy for users
  685. //    with tablets that want to "lock" a tool mode.
  686. //
  687. // ----------------------------------------------------------------------
  688. assignCommand -e -addDivider "Tablet Commands";
  689.  
  690. nameCommand -annotation "Lock Selection Mode Off (Press)"
  691.     -command ("TransformNoSelectOffTool")
  692.     lockSelectionModeOff;
  693.  
  694. nameCommand -annotation "Lock Selection Mode On  (Release)"
  695.     -command ("TransformNoSelectOnTool")
  696.     lockSelectionModeOn;
  697.  
  698. nameCommand -annotation "Tumble Tool On  (Press)"
  699.     -command ("TumbleTool")
  700.     pushTumbleContext_Tool;
  701.  
  702. nameCommand -annotation "Tumble Tool Off (Release)"
  703.     -command ("ToolLastTool")
  704.     popTumbleContext_Cmd;
  705.  
  706. nameCommand -annotation "Track Tool On  (Press)"
  707.     -command ("TrackTool")
  708.     pushTrackContext_Tool;
  709.  
  710. nameCommand -annotation "Track Tool Off (Release)"
  711.     -command ("ToolLastTool")
  712.     popTrackContext_Cmd;
  713.  
  714. nameCommand -annotation "Dolly Tool On  (Press)"
  715.     -command ("DollyTool")
  716.     pushDollyContext_Tool;
  717.  
  718. nameCommand -annotation "Dolly Tool Off (Release)"
  719.     -command ("LastTool")
  720.     popDollyContext_Cmd;
  721.  
  722. //
  723. //    Miscellaneous.
  724. //
  725. // ----------------------------------------------------------------------
  726. assignCommand -e -addDivider "Miscellaneous";
  727.  
  728. nameCommand -annotation "Help" 
  729.     -command ("Help") 
  730.     NameComHelp;
  731.  
  732. nameCommand -annotation "Save Keyframe for Rotate" 
  733.     -command ("SetKeyRotate")
  734.     NameComSave_Keyframe_for_Rotate;
  735.  
  736. nameCommand -annotation "Save Keyframe for Scale" 
  737.     -command ("SetKeyScale")
  738.     NameComSave_Keyframe_for_Scale;
  739.  
  740. nameCommand -annotation "Save Keyframe for Translate" 
  741.     -command ("SetKeyTranslate") 
  742.     NameComSave_Keyframe_for_Translate;
  743.  
  744. nameCommand -annotation "Duplicate Selected with Transforms" 
  745.     -command ("DuplicateWithTransform")
  746.     NameComDuplicate_Selected_with_Transforms;
  747.  
  748. nameCommand -annotation "Undo View Change" 
  749.     -command ("UndoViewChange")
  750.     NameComUndo_View_Change;
  751.  
  752. nameCommand -annotation "Redo View Change" 
  753.     -command ("RedoViewChange")
  754.     NameComRedo_View_Change;
  755.  
  756. nameCommand -annotation "Activate   Add Key Mode (Press)" 
  757.     -command ("AddKeyToolActivate")
  758.     NameComAdd_Key_Modifier;
  759.  
  760. nameCommand -annotation "Deactivate Add Key Mode (Release)"
  761.     -command ("AddKeyToolDeactivate")
  762.     NameComAdd_Key_Modifier_release;
  763.  
  764. nameCommand -annotation "Complete current Tool" 
  765.     -command ("CompleteCurrentTool")
  766.     NameComComplete_current_Tool1;
  767.  
  768. nameCommand -annotation "Abort Current Tool" 
  769.     -command ("AbortCurrentTool")
  770.     NameComAbort_Context;
  771.  
  772.  
  773. if    (`about -irix`) {
  774.     nameCommand -annotation "Desktop File Manager" 
  775.         -command ("DesktopFileManager")
  776.         NameComDesktop_File_Manager;
  777. }    
  778.  
  779. //    Manipulators.
  780. //
  781. nameCommand -annotation "Go to next manipulator handle" 
  782.     -command ("NextManipulatorHandle")
  783.     NameComGo_to_next_manipulator_handle;
  784. nameCommand -annotation "Go to previous manipulator handle" 
  785.     -command ("PreviousManipulatorHandle")
  786.     NameComGo_to_previous_manipulator_handle;
  787. nameCommand -annotation "Increase Manipulator Size" 
  788.     -command ("IncreaseManipulatorSize")
  789.     NameComIncrease_Manipulator_Size;
  790. nameCommand -annotation "Decrease Manipulator Size" 
  791.     -command ("DecreaseManipulatorSize")
  792.     NameComDecrease_Manipulator_Size;
  793.  
  794. //    Hotbox.
  795. //
  796. nameCommand -annotation "Pop Hotbox" 
  797.     -command ("ShowHotbox")
  798.     NameComPop_hotBox;
  799. nameCommand -annotation "Unpop Hotbox"
  800.     -command ("HideHotbox")
  801.     NameComUnpop_hotBox;
  802.  
  803. //    Pane pop.
  804. //
  805. nameCommand -annotation "Pop current pane" 
  806.     -command ("PanePop")
  807.     NameComPop_current_pane;
  808.  
  809. nameCommand -annotation "Close front window" 
  810.     -command ("CloseFrontWindow")
  811.     NameComClose_Front_Window;
  812.  
  813. //    Working frame.
  814. //
  815. nameCommand -annotation "Goto working frame" 
  816.     -command ("GoToWorkingFrame")
  817.     NameComGoto_working_frame;
  818. nameCommand -annotation "Set current frame as working frame" 
  819.     -command ("SetWorkingFrame")
  820.     NameComSet_current_frame_as_working_frame;
  821.  
  822. nameCommand
  823.     -annotation "Set keyboard focus to command line"
  824.     -command ("SetFocusToCommandLine")
  825.     "NameComSet_keyboard_focus_to_command_line" ;
  826. nameCommand
  827.     -annotation "Set keyboard focus to numeric input line"
  828.     -command ("SetFocusToNumericInputLine")
  829.     "NameComSet_keyboard_focus_to_numeric_input_line";
  830.  
  831. //    Application UI modes.
  832. //
  833. nameCommand -annotation "Show Poly Modeling UI" 
  834.     -command ("ShowModelingUI")
  835.     NameComShow_Poly_Modeling_UI;
  836. nameCommand -annotation "Show NURBs Modeling UI" 
  837.     -command ("ShowModelingUI")
  838.     NameComModeling_UI;
  839. nameCommand -annotation "Show Animation UI" 
  840.     -command ("ShowAnimationUI")
  841.     NameComAnimation_UI;
  842. nameCommand -annotation "Show Dynamics UI" 
  843.     -command ("ShowDynamicsUI")
  844.     NameComDynamics_UI;
  845. nameCommand -annotation "Show Rendering UI" 
  846.     -command ("ShowRenderingUI")
  847.     NameComRendering_UI;
  848. nameCommand -annotation "Show All UI" 
  849.     -command ("ShowAllUI")
  850.     NameComShow_All_UI;
  851.  
  852. nameCommand -annotation "Unparent Selected" 
  853.     -command ("Unparent")
  854.     NameComUnparent_Selected;
  855.  
  856. //    Virtual Time Slider.
  857. //
  858. nameCommand -annotation "Activate   Virtual Timeslider Mode (Press)" 
  859.     -command ("TimeDraggerToolActivate")
  860.     NameComVirtual_timeslider_modifier;
  861.  
  862. nameCommand -annotation "Deactivate Virtual Timeslider Mode (Release)" 
  863.     -command ("TimeDraggerToolDeactivate")
  864.     NameComVirtual_timeslider_modifier_release;
  865.  
  866. //    Marking menu for switching menubar mode.
  867. //
  868. nameCommand -annotation "Menubar Tab Switcher, with Marking Menu (Press)"
  869.     -command ("UIModeMarkingMenu")
  870.     NameMenubar_Switch;
  871.  
  872. nameCommand -annotation "Menubar Tab Switcher, with Marking Menu (Release)"
  873.     -command ("UIModeMarkingMenuPopDown")
  874.     NameMenubar_Switch_release;
  875.         
  876. nameCommand -annotation "Open Attribute Editor, or swap with Channel Box"
  877.     -command ("ShowAttributeEditorOrChannelBox")
  878.     OpenOrSwapAEWindow;
  879.  
  880. nameCommand -annotation "Toggle Main Menubar Visibility"
  881.     -command ("ToggleMainMenubar")
  882.     NameComToggle_Main_Menubar_Visibility;
  883.  
  884. nameCommand -annotation "Toggle Panel Menubar Visibility"
  885.     -command ("TogglePanelMenubar")
  886.     NameComToggle_Panel_Menubar_Visibility;
  887.  
  888. nameCommand -annotation "Hotbox Display Style - Rows Visible"
  889.     -command ("FullHotboxDisplay")
  890.     NameComHotbox_DisplayRows;
  891.  
  892. //    Pick walking.
  893. //
  894. nameCommand -annotation "Walk up the current hierarchy"
  895.     -command ("PickWalkUp")
  896.     NameComWalk_up_the_current_hierarchy;
  897.  
  898. nameCommand -annotation "Walk down the current hierarchy"
  899.     -command ("PickWalkDown")
  900.     NameComWalk_down_the_current_hierarchy;
  901.  
  902. nameCommand -annotation "Walk left in the current hierarchy"
  903.     -command ("PickWalkLeft")
  904.     NameComWalk_left_in_the_current_hierarchy;
  905.  
  906. nameCommand -annotation "Walk right in the current hierarchy"
  907.     -command ("PickWalkRight")
  908.     NameComWalk_right_in_the_current_hierarchy;
  909.  
  910. //    Pixel move.
  911. //
  912. nameCommand -annotation "Move up one pixel"
  913.     -command ("PixelMoveUp")
  914.     NameComMove_up_one_pixel;
  915.     
  916. nameCommand -annotation "Move down one pixel"
  917.     -command ("PixelMoveDown")
  918.     NameComMove_down_one_pixel;
  919.     
  920. nameCommand -annotation "Move left one pixel"
  921.     -command ("PixelMoveLeft")
  922.     NameComMove_left_one_pixel;
  923.  
  924. nameCommand -annotation "Move right one pixel"
  925.     -command ("PixelMoveRight")
  926.     NameComMove_right_one_pixel;
  927.  
  928. nameCommand -annotation "Repeat Last Action At Mouse Position" 
  929.     -command ("RepeatLastActionAtMousePosition")
  930.     NameComRepeat_Last_Action_At_Mouse_Position;
  931.  
  932. nameCommand -annotation "Go to Min Frame"
  933.     -command ("GoToMinFrame")
  934.     NameComGo_to_min_frame;
  935.  
  936. nameCommand -annotation "Cycle handle sticky state"
  937.     -command ("CycleIKHandleStickyState")
  938.     NameComCycle_handle_sticky_state;
  939.  
  940. nameCommand -annotation "Activate   Insert Key Mode (Press)"
  941.     -command ("InsertKeyToolActivate")
  942.     NameComInsert_Key_Modifier;
  943.  
  944. nameCommand -annotation "Deactivate Insert Key Mode (Release)"
  945.     -command ("InsertKeyToolDeactivate")
  946.     NameComInsert_Key_Modifier_release;
  947.  
  948. //    The following commands change the display smoothness of active (i.e.
  949. //    selected) objects.  They are similar in function to the menu items 
  950. //    under "Display->NURBS Smoothness->...", however the menu items can be 
  951. //    made to operate on all objects, not just selected ones.  Also, the 
  952. //    menu items have option boxes for setting various parameters, whereas 
  953. //    the commands below have fixed parameters.
  954. //
  955. //    So, in short, do not remove the below commands thinking that their 
  956. //    functionality is already available in the 
  957. //    "Display->NURBS Smoothness->..." menu.  The commands are supposed 
  958. //    to be there, in addition to the menu items.
  959. //
  960. nameCommand -annotation "Low Quality Display Setting"
  961.     -command ("LowQualityDisplay")
  962.     NameComLow_Quality_Display_Setting;
  963.  
  964. nameCommand -annotation "Medium Quality Display Setting"
  965.     -command ("MediumQualityDisplay")
  966.     NameComMedium_Quality_Display_Setting;
  967.  
  968. nameCommand -annotation "High Quality Display Setting"
  969.     -command ("HighQualityDisplay")
  970.     NameComHigh_Quality_Display_Setting;
  971.  
  972. nameCommand -annotation "Set Display Quality Marking Menu (Press)"
  973.     -command ("QualityDisplayMarkingMenu")
  974.     Name_QualityDisplay_Menu;
  975.  
  976. nameCommand -annotation "Set Display Quality Marking Menu (Release)"
  977.     -command ("QualityDisplayMarkingMenuPopDown")
  978.     Name_QualityDisplay_Menu_release;
  979.  
  980. nameCommand -annotation "Select Next Intermediate Object"
  981.     -command ("SelectNextIntermediatObject")
  982.     NameComSelect_Next_Intermediate_Object;
  983.  
  984. //    Convert polygon selection.
  985. //
  986. nameCommand -annotation "Convert Selection to Vertices"
  987.     -command ("ConvertSelectionToVertices")
  988.     ConvertSelectionToVerticesNameCommand;
  989.  
  990. nameCommand -annotation "Convert Selection to Edges"
  991.     -command ("ConvertSelectionToEdges")
  992.     ConvertSelectionToEdgesNameCommand;
  993.  
  994. nameCommand -annotation "Convert Selection to Faces"
  995.     -command ("ConvertSelectionToFaces")
  996.     ConvertSelectionToFacesNameCommand;
  997.  
  998. nameCommand -annotation "Convert Selection to UVs"
  999.     -command ("ConvertSelectionToUVs")
  1000.     ConvertSelectionToUVsNameCommand;
  1001.  
  1002. nameCommand -annotation "Grow Selection Region"
  1003.     -command ("GrowPolygonSelectionRegion")
  1004.     GrowPolygonSelectionRegionNameCommand;
  1005.  
  1006. nameCommand -annotation "Shrink Selection Region"
  1007.     -command ("ShrinkPolygonSelectionRegion")
  1008.     ShrinkPolygonSelectionRegionNameCommand;
  1009.  
  1010. // Cut Copy and Paste
  1011. //
  1012. nameCommand
  1013.     -annotation "CutSelectedNameCommand"
  1014.     -command ("CutSelected")
  1015.     CutSelectedNameCommand;
  1016.  
  1017. nameCommand
  1018.     -annotation "CopySelectedNameCommand"
  1019.     -command ("CopySelected")
  1020.     CopySelectedNameCommand;
  1021.  
  1022. nameCommand
  1023.     -annotation "PasteSelectedNameCommand"
  1024.     -command ("PasteSelected")
  1025.     PasteSelectedNameCommand;
  1026.  
  1027. jasperNamedCommandSetup();
  1028. artisanNamedCommandSetup();
  1029.  
  1030. if (`isTrue "SubdivUIExists"`) {
  1031.     nameCommand -annotation "Coarser Level" 
  1032.         -command ("CoarserSubdivLevel")
  1033.     NameComSubdiv_Surfaces_Coarser_Refinement;
  1034.  
  1035.     nameCommand -annotation "Subdiv Create Region" 
  1036.         -command ("CreateSubdivRegion")
  1037.     NameComSubdiv_Create_Region;
  1038. }
  1039.  
  1040. if( fluidEditLicenseFound() ) {
  1041.     nameCommand -annotation "Decrement Fluid Sub-Volume Location"
  1042.         -command "DecrementFluidCenter"
  1043.         NameComFluids_DecrementFluidCenter;
  1044.     nameCommand -annotation "Increment Fluid Sub-Volume Location"
  1045.         -command "IncrementFluidCenter"
  1046.         NameComFluids_IncrementFluidCenter;
  1047. }
  1048.  
  1049. if (`isTrue "MayaCreatorExists"`) {
  1050.     creatorNamedCommandSetup();
  1051. }
  1052.  
  1053. assignCommand -e -addDivider "User Defined";
  1054.  
  1055.     // don't add anything after this point
  1056.